/**
 * FileFind - ftp/shares indexing and search php engine
 * Module: common-webapp
 * Description: Common classes for different webapp implementations
 * Copyright (c) 2003-2010 Rage Steel, www.gt2.ru
 */
package ru.ffind.webapp.beans;

import java.util.Collections;
import java.util.List;
import javax.naming.directory.SearchResult;

import ru.ffind.common.model.SearchQuery;

/**
 * Bean for search query manipulations.
 * 
 * @author Rage Steel
 */
public class AbstractSearchQueryBean {

	/**
	 * Query string, as sent by user.
	 */
	private SearchQuery query = new SearchQuery(null);

	/**
	 * Get query string.
	 * 
	 * @return
	 */
	public String getQuery() {
		return query.getUserQuery();
	}

	/**
	 * Set query string.
	 * 
	 * @param query
	 */
	public void setQuery(String query) {
		this.query = new SearchQuery(query);
	}

	/**
	 * Return a formatted user query.
	 * 
	 * @return
	 */
	public String getUserQuery() {
		return "Sorry, <small>not implemented yet</small>!";
	}

	/**
	 * Return true if search query returned results.
	 * 
	 * @return
	 */
	public boolean isHasResults() {
		return false;
	}

	/**
	 * Return search results.
	 * 
	 * @return
	 */
	public List<SearchResult> getResults() {
		return Collections.emptyList();
	}

}
